OrderFormCtl = Ext.extend(FormCtl, {

			configItems : function(config) {

				var depUrl = cf.getC('s').getUrl({

							resource : 'department.do',
							act : 'findAll'

						});

				var userUrl = cf.getC('s').getUrl({

							resource : 'user.do',
							act : 'readCbb'

						});

				var items = {
					departmentid : this.getCombobox('部门', 'departmentid',
							false, depUrl, true),
					pmgrid : this.getCombobox('项目经理', 'pmgrid', false, userUrl,
							false),
					contractid : this.getHiddenField('contractid')
				};

				var groupItems = [{
							columnWidth : .3,
							layout : 'form',// 第一列里面内容就是form排序了,从上到下
							items : [items.departmentid]
						}, {
							columnWidth : .4,
							layout : 'form',// 第一列里面内容就是form排序了,从上到下
							items : [items.pmgrid]
						}, {
							columnWidth : .3,
							layout : 'form',// 第一列里面内容就是form排序了,从上到下
							items : [items.contractid]
						}];

				items['departmentid'].on('select', this.selectDepartment, this);

				config.items = groupItems;
				this.items = items;

				return config;

			},
			selectDepartment : function(c, r, i) {

				var record = r;

				var items = this.items;

				items['pmgrid'].cbbStore.load({
							params : {
								departmentid : r.get('key')
							}
						});

			},
			getCommonConfig : function() {

				var config = {
					split : true,
					autoScroll : true,
					region : 'center',
					layout : 'column',
					labelAlign : 'right',
					labelWidth : 100,
					frame : true
				};

				return config;

			},
			load : function(contractid) {

				var items = this.items;
				items.contractid.setValue(contractid);;

			},
			getSubmitUrl : function() {

				return 'task.do?m=save';

			},
			getParams : function(config) {

				var items = this.getAllItems();

				var params = {
					itemlist : Ext.encode(items)
				};

				config.params = params

				return config;

			},
			getAllItems : function() {

				var oigc = cf.getC('oigc');
				var records = oigc.getSelectList();

				var idList = [];
				for (var i = 0; i < records.length; i++) {
					idList.push({
								id : records[i].get('id')
							});
				}

				return idList;

			},
			submitSuccess : function() {
				var ogc = cf.getC('ogc');
				ogc.reload();
			}

		});
